import instance from "../utils/request";

//获取商品列表
export function getcommoditydata() {
  return instance({
    url: "/admin/pro/list/?count=1&limitNum=10",
    method: "get",
  });
}

//获取商品详情
export function proItemdata(id) {
  return instance({
    url: `/admin/pro/detail/?proid=${id}`,
    method: "get",
  });
}

//获取秒杀或推荐商品列表
export function showdata(obj) {
  return instance({
    url: "/admin/pro/showdata",
    method: "post",
    data: obj,
  });
}

//修改秒杀与推荐
export function updateFlag(obj) {
  return instance({
    url: "/admin/pro/updateFlag",
    method: "post",
    data: obj,
  });
}

//筛选商品
export function searchPro(obj) {
  return instance({
    url: "/admin/pro/searchPro",
    method: "post",
    data: obj,
  });
}

//获取商品分类
export function classification() {
  return instance({
    url: "/admin/pro/getCategory",
    method: "get",
  });
}

//获取商品总数量
export function getpronum() {
  return instance({
    url: "/admin/statistic/product",
    method: "get",
  });
}

//获取搜索关键词列表
export function getsearchlist() {
  return instance({
    url: "/admin/search/list",
    method: "get",
  });
}
